{extend name="common/main"/}

{block name="body"}
	<div class="main-title">
		<h2>扩展配置项</h2>
	</div>
    <div class="with-padding">
        <form action="{:url()}" method="post" class="form-horizontal">
            <div class="form-item builder_item">
                <label class="item-label">唯一标识<span class="check-tips">（只能使用英文、下划线且不能重复）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large form-control" style="width: 400px" name="name" value="{$info.name|default=''}">
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">标题<span class="check-tips">（用于后台显示的扩展配置标题）</span></label>
                <div class="controls">
                    <input type="text" class="text input-large form-control" style="width:400px;" name="title" value="{$info.title|default=''}">
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">排序<span class="check-tips">（用于分组显示的顺序）</span></label>
                <div class="controls">
                    <input type="text" class="text input-small form-control" style="width: 400px" name="sort" value="{$info.sort|default=0}">
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">类型<span class="check-tips">（系统会根据不同类型解析配置值）</span></label>
                <div class="controls">
                    <select name="type" class="form-control" style="width:auto;">
                        {volist name="type" id="type"}
                        <option value="{$key}">{$type}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">分组<span class="check-tips">（用于批量设置）</span></label>
                <div class="controls">
                    <select name="group" class="form-control">
                        {volist name="group" id="group"}
                        <option value="{$key}">{$group}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">配置值<span class="check-tips">（配置值）</span></label>
                <div class="controls">
                    <label class="textarea input-large">
                        <textarea name="value" class="form-control" style="width: 400px;height: 200px">{$info.value|default=''}</textarea>
                    </label>
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">配置项<span class="check-tips">（如果是枚举型 需要配置该项）</span></label>
                <div class="controls">
                    <label class="textarea input-large">
                        <textarea name="extra" class="form-control" style="width: 400px;height: 200px">{$info.extra|default=''}</textarea>
                    </label>
                </div>
            </div>
            <div class="form-item builder_item">
                <label class="item-label">说明<span class="check-tips">（配置详细说明）</span></label>
                <div class="controls">
                    <label class="textarea input-large">
                        <textarea name="remark" class="form-control" style="width: 400px;height: 200px">{$info.remark|default=''}</textarea>
                    </label>
                </div>
            </div>
            <div class="form-item builder_item">
                <input type="hidden" name="id" value="{$info.id|default=''}">
                <button class="btn btn-success submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确定</button>
                <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返回</button>
            </div>
        </form>
    </div>

{/block}

{block name="script"}
<script type="text/javascript">
    Think.setValue("type", "{$info.type|default='num'}");
    Think.setValue("group", {$info.group|default=1});
</script>
{/block}
